Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issues to work with zig 0.11 #1

Closed
wants to merge 1 commit into from

Conversation

diegopacheco
Copy link

@diegopacheco diegopacheco commented Aug 28, 2023

I was getting lots of compilation errors with zig 0.11 like:

❯ zig build run
zig build-exe zbench-fun Debug native: error: the following command failed with 2 compilation errors:
/home/diego/bin/zig-linux-x86_64-0.11.0-dev.3395+1e7dcaa3a/zig build-exe /mnt/e35d88d4-42b9-49ea-bf29-c4c3b018d429/diego/git/diegopacheco/zig-playground/zbench-fun/src/main.zig --cache-dir /mnt/e35d88d4-42b9-49ea-bf29-c4c3b018d429/diego/git/diegopacheco/zig-playground/zbench-fun/zig-cache --global-cache-dir /home/diego/.cache/zig --name zbench-fun --mod zbench::/mnt/e35d88d4-42b9-49ea-bf29-c4c3b018d429/diego/git/diegopacheco/zig-playground/zbench-fun/lib/libs/zbench/zbench.zig --deps zbench --listen=- 
Build Summary: 0/5 steps succeeded; 1 failed (disable with -fno-summary)
run transitive failure
└─ run zbench-fun transitive failure
   ├─ zig build-exe zbench-fun Debug native 2 errors
   └─ install transitive failure
      └─ install zbench-fun transitive failure
         └─ zig build-exe zbench-fun Debug native (reused)
lib/libs/zbench/zbench.zig:250:37: error: expected type 'u8', found 'usize'
        const currentProgress: u8 = @truncate(usize, progress);

Same for @intCast

Here is a simple fix for zig 0.11

@hendriknielaender
Copy link
Owner

Hey @diegopacheco, thank you opening a PR, and for taking the time to propose a fix for Zig 0.11. I've run tests using both the development and non-development builds of Zig 0.11. It appears that the development build (0.11.0-dev.3395+1e7dcaa3a) does indeed fail due to API changes, as you pointed out.

I've implemented a basic CI pipeline that includes build tests for both your development build version and the stable 0.11 version. The pipeline verifies that the build for the development version is currently failing, while the build for the stable 0.11 version passes successfully. #2

Zig is in active development and the APIs can change frequently, making it challenging to support every dev build. This project currently aims to be compatible with stable, non-development builds to provide a consistent experience for the users.

That being said, I appreciate your effort in proposing a fix, and I'd be open to reviewing a pull request if you'd like to contribute.

@diegopacheco
Copy link
Author

@hendriknielaender

Thanks for the reply. It is up to you, did the PR to help, and if you review and merge it great.

@hendriknielaender
Copy link
Owner

After further review, I've decided to close the PR as it targets an outdated development build that is no longer compatible with the latest stable release, 0.11.0. As Zig is in active development, ensuring compatibility with every dev build can be challenging. The focus is primarily on maintaining compatibility with stable releases to provide a consistent experience for users.

I've updated the README to include a "Compatibility Notes" section, which will guide users on which versions of Zig are supported. Additionally, I've set up a basic CI pipeline that builds against the latest stable and master branch of Zig, ensuring that we catch any compatibility issues early on.

Your suggestions and contributions are always welcome in the future. Thank you again for your interest in improving the project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants